/******************************init****************************/
function queryRecruitInfo(page) {
	var parm = $('#queryRecruitInfoForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('recruitinfo-query');
	sys_record_parm('recruitinfo',parm);
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}

function deleteRecruitInfo(code) {
	$.Zebra_Dialog('是否删除',{
	'type': 'question',
	'title': '警告' ,
	'buttons':[
       {caption:'删除',callback:function() {
    	   var url = create_url('recruitinfo-delete');
		   recruitInfo_aidExecute(code, url);
		}},
       {caption:'取消',callback:function(){}
    	}]
	});
}

function recruitInfo_aidExecute(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功');
				queryRecruitInfo();
			} else {
				sys_msg('操作失败');
				queryRecruitInfo();
			}
		}
	});
}

function editRecruitJoin(code){
	var url = create_url('recruitinfo-aidInit');
	var parm = {"code": code};
	$.colorbox({overlayClose:false, href:url, data:parm, close:'[关闭]', width:'750px',height:'500px', open:true});
}
function applyIndexShow(btn, code, oc) {
	$.Zebra_Dialog('是否要申请展示',{
	'type': 'question',
	'title': '警告' ,
	'buttons':[
       {caption:'申请',callback:function() {
    	   var parm = {'code':code, 'oc':oc };
			var url = create_url('parkrecruit-applyshow');
			sys_submiting();
			$.ajax({type:'POST', url:url, data:parm,
				success: function(result) {
					sys_submiting_close();
					if ('success' == result) {
						sys_msg('申请成功');
						queryRecruitInfo();
					} else {
						sys_msg('操作失败');
						queryRecruitInfo();
					}
				}
			});
		}},
       {caption:'取消',callback:function(){}
    	}]
	});
}
/******************************edit****************************/
function saveRecruitInfo() {
	var parm = $('#editRecruitInfoForm').serialize() + '&content=' + fixJqText(Url.encode(content.getData()));
	var url = create_url('recruitinfo-save');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
		sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功!');
				sys_load_handle('recruitinfo');
			}
		}
	});
}

function checkedRecruitInfo(){
	var post=$("#post").val();
	var age=$("#age").val();
	var eb=$("#eb").val();
	var major=$("#major").val();
	var num=$("#num").val();
	var phone=$("#phone").val();
	if(post.length==0){
		sys_msg('必须填写招聘职位');
		return
	}
	if(age.length==0){
		sys_msg('必须填写年龄');
		return
	}
	if(eb.length==0){
		sys_msg('必须填写学历');
		return
	}
	if(major.length==0){
		sys_msg('必须填写专业');
		return
	}
	if(num.length==0){
		sys_msg('必须填写招聘人数');
		return
	}else if(!$.isNumeric(num)&& num>0){
		sys_msg('招聘人数必须是数字并且必须大于0');
		return
	}
	if(phone.length==0){
		sys_msg('必须填写电话');
		return
	}
	saveRecruitInfo();
	
}
/******************************aidinit****************************/
function queryRecruitJoin(page) {
	var parm = $('#queryRecruitJoinForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('recruitinfo-aidList');
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList1').html(result);
		}
	});
}

function chooseDetail(code) {
	var url = create_url('recruitinfo-aidEdit');
	var parm = {'code': code};
	$.colorbox({overlayClose:false, href:url, data:parm, close:'[关闭]', width:'800px',height:'600px', open:true});
}
/************aidinit******************/

